const {
    Comment
} = require('../../../model/Comment');

module.exports = async (req, res) => {
    // 获得传递过来的文章id
    const postId = req.params['id'];
    let comments = await Comment.find({
        post: postId
    }).populate('author').sort('-createAt');
    res.send(comments);
}